package com.share.cloudStorage.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: javaKing
 * @Date: 2024/12/09/15:19
 * @Description:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Integer code;
    private String msg;
    private Object data;

    public static Result ok(){
        return new Result(200,"操作成功",null);
    }

    public static Result ok(String msg){
        return new Result(200,msg,null);
    }

    public static Result ok(Object data){
        return new Result(200,"操作成功",data);
    }



    public static Result ok(Integer code,String msg,Object data){
        return new Result(code,msg,data);
    }

    public static Result fail(String msg){
        return new Result(500,msg,null);
    }

    public static Result fail(String msg,Object data){
        return new Result(500,msg,data);
    }
}